home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Mac Power 1997 December
/
MACPOWER-1997-12.ISO.7z
/
MACPOWER-1997-12.ISO
/
AMUG
/
PROGRAMMING
/
Raven 1.2 Examples.sit
/
Raven 1.2 Examples
/
BoxPaint
/
Source
/
Window.cpp
< prev
next >
Wrap
Text File
|
1997-02-20
|
3KB
|
124 lines
/*
* File: Window.cpp
* Summary: A window into the document's data.
* Written by: Jesse Jones
*
* Copyright ゥ 1996 Jesse Jones.
* For conditions of distribution and use, see copyright notice in ZTypes.h
*
* Change History (most recent first):
*
* <-> 5/26/96 JDJ Created
*/
#include "Window.h"
#include <ZEvent.h>
#include <ZStream.h>
#include "Doc.h"
#include "Pane.h"
//-----------------------------------
// Constants
//
const short kSavedVersion = 0; // Version number of the saved data
// ===================================================================================
// class CWindow
// ===================================================================================
// Registers CWindow::Create with the reanimator so that the window
// can be reanimated from a 'Wind' resource. Note that the "Dead
// Strip Static Initialization Code" linker preference should be off.
static TReanimatorRegister<CWindow> sMyWindowRegistrar;
//---------------------------------------------------------------
//
// CWindow::~CWindow
//
//---------------------------------------------------------------
CWindow::~CWindow()
{
}
//---------------------------------------------------------------
//
// CWindow::CWindow
//
//---------------------------------------------------------------
CWindow::CWindow()
{
}
//---------------------------------------------------------------
//
// CWindow::OnReanimated
//
//---------------------------------------------------------------
void CWindow::OnReanimated()
{
Inherited::OnReanimated();
CPane* pane = dynamic_cast<CPane*>(this->FindSubPane("3D Pane"));
ASSERT(pane != nil);
this->SetLatentTarget(pane);
}
//---------------------------------------------------------------
//
// CWindow::Create [static]
//
//---------------------------------------------------------------
MReanimatable* CWindow::Create(MReanimatable* parent)
{
// When creating views parent is the superView. When creating
// windows parent should be nil. (TWindow::Create takes care
// of setting the window's superCommander).
ASSERT(parent == nil);
return new CWindow;
}
#pragma mark ハ
//---------------------------------------------------------------
//
// CWindow::OnMenuCommand
//
//---------------------------------------------------------------
bool CWindow::OnMenuCommand(const MenuCommand& command)
{
bool handled = false;
if (!handled)
handled = Inherited::OnMenuCommand(command);
return handled;
}
//---------------------------------------------------------------
//
// CWindow::OnCommandStatus
//
//---------------------------------------------------------------
bool CWindow::OnCommandStatus(const MenuCommand& command, SCommandStatus& status)
{
bool handled = false;
if (!handled)
handled = Inherited::OnCommandStatus(command, status);
return handled;
}